/**
 *
 */
package cosc617_blackteam;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * The class represents user comments
 *
 * @author Laura Semesky
 */

public class Comment{
	private String name;
	private String comment;
	private Date date;
	private boolean approved;
	
	public Comment(String name, String comment){
		this.name = name;
		this.comment = comment;
		Calendar cal = Calendar.getInstance();
		date = cal.getTime();
		approved = false;
	}
	
	public String toString(){
		DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy hh:mm a");
		return "Name: " + name + "\nDate: " + dateFormat.format(date) + "\nComment: " + comment + "\n";
	}
	
	public boolean isApproved(){
		return approved;
	}
	
	public void setApproved(boolean b){
		approved = b;
	}

    public Comment copy() {
        return new Comment(this.name, this.comment);
    }

}
